<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>DWR框架实现全国省市区下拉列表联动</title>
</head>
<script type='text/javascript' src='/AjaxDwrDemo/dwr/interface/china.js'></script>
<script type='text/javascript' src='/AjaxDwrDemo/dwr/engine.js'></script>
<script type='text/javascript' src='/AjaxDwrDemo/dwr/util.js'></script>
<script type="text/javascript">
function getProvince() {
	china.getProvince(function (provinces){
		getCity(0);
		DWRUtil.removeAllOptions("province");
		DWRUtil.addOptions("province",provinces,"id","name");
	});
}
function getCity(father) {
	//alert("getCity()");
	china.getCity(father, function (citys){
		getArea(0);
		DWRUtil.removeAllOptions("city");
		DWRUtil.addOptions("city",citys,"id","name");
	});
}
function getArea(father) {
	china.getArea(father, function (areas){
		DWRUtil.removeAllOptions("area");
		DWRUtil.addOptions("area",areas,"id","name");
	});
}
</script>

<body onload="getProvince()">
	<h2>DWR框架实现全国省市区下拉列表联动</h2>
	省&nbsp;<select id="province" onchange="getCity(this.value)">
	</select>&nbsp;
	市&nbsp;<select id="city" onchange="getArea(this.value)">
	</select>&nbsp;
	区&nbsp;<select id="area">
	</select>
</body>
</html>